package school;

import java.util.Date;
import school.course.Course;


public class Student extends Person {

	public StudentCourseList courses = new StudentCourseList();
	public Student() {

	}

	public void removeCourse(Course course) {
		if (courses.remove(course)) {
			course.removeStudent(this);
		}
	}
	
	public boolean addCourse(Course course) {
		if (!courses.contains(course)) {
			if (courses.add(course)) {
				return course.addStudent(this);
			}
			return false;
		}
		return true;
	}
	
	/* 
	 * return courses that are within the startDate and endDate includes both bounds
	 * if the bound is null, assume there is no bound
	 */
	public Course[] getCoursesByDateRange(Date startDate, Date endDate) {
		return courses.getCoursesByDateRange(startDate, endDate);
	}

	public Course[] getFutureCourses() {
		return courses.getFutureCourses();
	}

	public Course[] getCurrentCourses(){
		return courses.getCurrentCourses();
	}
	
	public Course[] getCourses(){
		return courses.ToArray();
	}
}
